import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '@/views/LoginView.vue'
import HomeView from '@/views/HomeView.vue'
import user from '@/views/user.vue'
import carousel from '@/views/carousel.vue'
import saishi from '@/views/saishi/saishi.vue'
import saishiorder from '@/views/saishi/saishiorder.vue'
import saishicollection from '@/views/saishi/saishi_collection.vue'
import ground from '@/views/ground/ground.vue'
import groundorder from '@/views/ground/groundorder.vue'
import groundcollection from '@/views/ground/ground_collection.vue'
import groundpreserve from '@/views/ground/ground_preserve.vue'
import product from '@/views/product/product.vue'
import productcollection from '@/views/product/product_collection.vue'
import productorder from '@/views/product/product_order.vue'

import index from '@/views/Index.vue'
import ground_ui from '@/views/ground/ground_ui.vue'
import register from "@/views/RegisterView.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/ground_ui',
    name: 'ground_ui',
    component: ground_ui
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
	children:[
		{
			path: 'saishi',
			name: 'saishi',
			component: saishi
		},
		{
			path: 'saishiorder',
			name: 'saishiorder',
			component: saishiorder
		},
		{
			path: 'saishicollection',
			name: 'saishicollection',
			component: saishicollection
		},
		{
			path: 'ground',
			name: 'ground',
			component: ground
		},
		{
			path: 'groundorder',
			name: 'groundorder',
			component: groundorder
		},
		{
			path: 'groundcollection',
			name: 'groundcollection',
			component: groundcollection
		},
		{
			path: 'groundpreserve',
			name: 'groundpreserve',
			component: groundpreserve
		},
		{
			path: 'product',
			name: 'product',
			component: product
		},
		{
			path: 'productcollection',
			name: 'productcollection',
			component: productcollection
		},
		{
			path: 'productorder',
			name: 'productorder',
			component: productorder
		},
		{
			path: 'user',
			name: 'user',
			component: user
		},
		{
			path: 'carousel',
			name: 'carousel',
			component: carousel
		}
	]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
